From: Andrea Azzarone Date: Thu, 21 Jun 2018 16:40:43 +0000 (+0200) Subject: popupMenu: Don't handle key presses directly if there are modifiers X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~5^2~9 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2e90c5fa4b35ebe26c694223966834ee949cfce3;p=gnome-shell.git popupMenu: Don't handle key presses directly if there are modifiers Key events involved in a keyboard shortcut are not completely consumed by Mutter. That means that if the popupMenu is bound to a shortcut (e.g. Alt) and the user keeps the keys pressed, the same key-event will be delivered to the popupMenu. We can workaround this issue filtering out all the events where a a modifier is down (except capslock). Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/372 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 83194d72b..f449d6e7e 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -141,8 +141,17 @@ var PopupBaseMenuItem = new Lang.Class({ }, _onKeyPressEvent(actor, event) { - let symbol = event.get_key_symbol(); + let state = event.get_state(); + // if user has a modifier down (except capslock) + // then don't handle the key press here + state &= ~Clutter.ModifierType.LOCK_MASK; + state &= Clutter.ModifierType.MODIFIER_MASK; + + if (state) + return Clutter.EVENT_PROPAGATE; + + let symbol = event.get_key_symbol(); if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) { this.activate(event); return Clutter.EVENT_STOP;